home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / hardware / test.exe / TESTW.PAS < prev   
Pascal/Delphi Source File  |  1993-03-29  |  1KB  |  54 lines

  1. Program TestW;  { 1993 NewsMaker Systems. Freeware }
  2.  
  3.      { Start this program first }
  4.  
  5. Uses Dos,Crt;
  6.  
  7. Type TestRec = Array[1..512] Of Byte;
  8.  
  9. Var X : Integer;
  10.     TestBuf : TestRec;
  11.     I : Integer;
  12.     OutFile : File Of TestRec;
  13.     OutputValue : Byte;
  14.     LoopCount: LongInt;
  15.  
  16. Begin
  17.  
  18. FillChar (TestBuf,SizeOf(TestBuf),Ord('0'));  { Init TestBuf with 0 }
  19.  
  20. Assign (OutFile, 'TEST.DAT');    { Create the test file }
  21. Rewrite (OutFile);
  22. Write (OutFile, TestBuf);
  23. Close (OutFile);
  24.  
  25. ClrScr;
  26. TextColor(LightRed);
  27. Write('TESTW  ');
  28. TextColor(White);
  29. HighVideo;
  30. Write('Writing TEST.DAT file.                    Press ALT to Quit');
  31. LowVideo;
  32.  
  33. Window(1,2,80,25);
  34.  
  35. LoopCount := 0;
  36. OutputValue := 1;
  37.  
  38. While Mem[$40:$17] AND byte($08) = 0 Do { Check for ALT key }
  39.   Begin
  40.   FileMode := $22;          { Open for Read/Write, Deny Write (allow read) }
  41.   Assign (OutFile, 'TEST.DAT');
  42.   Reset (OutFile);
  43.  
  44.   FillChar (TestBuf,SizeOf(TestBuf),OutputValue+Ord('0'));  {1-9}
  45.   Inc (OutputValue);
  46.   If OutputValue >=10 Then OutputValue := 1;
  47.  
  48.   Write (OutFile, TestBuf);
  49.   inc(LoopCount);
  50.  { If LoopCount Mod 10 = 0 then }  { Can be added to speed Writes }
  51.     WriteLn ('OK ',Char(TestBuf[1]),' ',LoopCount);
  52.   Close (OutFile);
  53.   End;
  54. End.